from django.db import models


class UserLog(models.Model):
    ip = models.CharField(max_length=32, verbose_name='访问IP')
    visit_time = models.DateTimeField(auto_now=True)
    method = models.CharField(max_length=64, verbose_name='请求方法')
    path = models.CharField(max_length=64, verbose_name='请求路径')
    user_agent = models.TextField(verbose_name='用户代理信息')
    browser = models.CharField(max_length=64, verbose_name='用户浏览器信息')
    version = models.CharField(max_length=64, verbose_name='浏览器版本信息')

    class Meta:
        db_table = 'user_log'
        verbose_name_plural = '用户日志表'
